AddFromProjectTemplateService
global with sharing class AddFromProjectTemplateService
a service used to clone related records between projects. core fields of copied objects are also copied.
This class contains deprecated items.
Methods
addFromTemplates
global static List<AddFromProjectTemplateService.AddFromProjectResponse> addFromTemplates(List<AddFromProjectTemplateService.AddFromProjectRequest> requests)
This method clones related records between projects using the details specified. Multiple requests are executed asynchronously and sequentially, in the given order.
Input Parameters
Return Value
This service returns values in the AddFromProjectResponses list in response to the requests in the input list.
Sample Code
//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.
You need to provide some sample code
Deprecated
The following items are deprecated and not supported for use. We recommend that you stop using these items to avoid exceptions.
Methods
addTasksFromTemplates
Deprecated: Use addFromTemplates(List requests) instead.
global static List<AddFromProjectTemplateService.AddFromProjectResponse> addTasksFromTemplates(List<AddFromProjectTemplateService.ProjectTaskRequest> requests)
This method clones project tasks between projects using the details specified. Multiple requests are executed asynchronously and sequentially, in the given order.
Input Parameters
Return Value
This service returns AddFromProjectResponses in a list that parallels the input list.
Sample Code
//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.
You need to provide some sample code
AddFromProjectTemplateService.AddFromProjectRequest
global abstract class AddFromProjectRequest
the request structure for the addfromprojecttemplateservice.
Properties
DestinationProjectId |
Id |
the project id that related records are copied to.
|
Mappers |
List<SObjectCloneMapper> |
the sobjectclonemapper list defining which fields are copied for which sobjects when adding related records from a template. This is in addition to the default objects and fields as well as the fields contained in the field sets. Mappers can be used to select specific related records to copy. See SObjectCloneMapper.
|
StartDate |
Date |
the date after which to insert the related objects. If the Work_Calendar__c field on the Project_Task__c sObject has been included in either Project Task field set or passed as a Mapper on this request, project tasks are adjusted into working time after the offset is applied. This determines the working days according to the Work_Calendar__c on each Project Task.
|
TemplateProjectId |
Id |
the template project id that related records are copied from.
|
AddFromProjectTemplateService.ProjectTaskRequest
global with sharing class ProjectTaskRequest extends AddFromProjectRequest
the request structure for adding tasks from template only. to be used with addfromtemplates. Tasks are scheduled so that the earliest task will start on StartDate. If EndDate is set, tasks are scheduled so that the latest ending task will end on EndDate. Tasks are appended to the bottom of the hierarchy of the destination project. The WBS of the copied tasks is cleared, it can be regenerated by opening the project in Gantt. Fields are copied from a project task field set that is referenced in the following custom settings: • Template Proj Task Fieldset • Template Proj Alt Copy Task Fieldset
Properties
CopyMilestones |
Boolean |
copies milestones that are associated with project tasks, which are not copied by default. Fields are copied from a Milestone field set that is referenced in the following custom settings: • Template Proj MS Fieldset • Template Proj Alt Copy MS Fieldset
|
CopyProjectTaskAssignments |
Boolean |
copy project task assignments (ptas), they are not copied by default. Fields are copied from a project task assignment field set that is referenced in the following custom settings: • Template Proj Copy PTA Fieldset
|
EndDate |
Date |
the last date that the copied related objects should end on. If this field is set, StartDate must be null. If the Work_Calendar__c field on the Project_Task__c sObject has been included in either of the Project Task field sets or passed as a Mapper on this request, project tasks are adjusted into working time after the offset is applied. This determines the working days according to the Work_Calendar__c on each project task.
|
Methods
ProjectTaskRequest
global ProjectTaskRequest(Id templateProjectId, Id destinationProjectId)
A default constructor with minimum required properties.
Input Parameters
templateProjectId |
Id |
The project template ID. |
destinationProjectId |
Id |
The destination project ID. |
AddFromProjectTemplateService.MilestoneRequest
global with sharing class MilestoneRequest extends AddFromProjectRequest
the request structure for adding milestones from template only. to be used with addmilestonesfromtemplates. Fields are copied from a Milestone field set that is referenced in the following custom settings: • Template Proj MS Fieldset • Template Proj Columns MS Fieldset • Template Proj Alt Copy MS Fieldset
Properties
CopyRisks |
Boolean |
copies risks, which are are not copied by default. Fields are copied from a Risk field set that is referenced in the following custom settings: • Template Proj Risk Fieldset • Template Proj Alt Copy Risk Fieldset
|
Methods
MilestoneRequest
global MilestoneRequest(Id templateProjectId, Id destinationProjectId)
A default constructor with minimum required properties.
Input Parameters
templateProjectId |
Id |
The project template ID. |
destinationProjectId |
Id |
The destination project ID. |
AddFromProjectTemplateService.ResourceRequestToProjectRequest
global with sharing class ResourceRequestToProjectRequest extends AddFromProjectRequest
the request structure for adding resource requests to a project. to be used with addfromtemplates. Fields are copied from a Resource Request field set that is referenced in the following custom settings: • Template Proj RR Fieldset • Template Proj Columns RR Fieldset • Template Proj Alt Copy RR Fieldset
Properties
CopyResourceSkillRequests |
Boolean |
copies resource skill requests, which are are not copied by default. Fields are copied from a Resource Skill Request field set that is referenced in the Resource Skill Request Fieldset custom setting.
|
Methods
ResourceRequestToProjectRequest
global ResourceRequestToProjectRequest(Id templateProjectId, Id destinationProjectId)
A default constructor with minimum required properties.
Input Parameters
templateProjectId |
Id |
The project template ID. |
destinationProjectId |
Id |
The destination project ID. |
AddFromProjectTemplateService.AddFromProjectResponse
global class AddFromProjectResponse
the response structure returned for each request.
Properties
Request |
AddFromProjectTemplateService.AddFromProjectRequest |
the request associated with the response of addfromprojecttemplateservice.
|
Errors |
List<AddFromProjectTemplateService.AddFromProjectError> |
stores error messages that occur when executing methods from addfromprojecttemplateservice.
|
QueuedJobId |
Id |
the addfromprojecttemplateservice creates queueables to complete the work in later transactions. This is the ID of the AsyncApexJob controlling the work. The record can be queried to monitor its status. When multiple requests are processed, only the QueuedJobId of the first response is set.
|
Methods
isSuccess
global Boolean isSuccess()
Indicates if the request was queued successfully.
AddFromProjectTemplateService.AddFromProjectError
global with sharing class AddFromProjectError
stores error messages that occur when executing methods from addfromprojecttemplateservice.
Properties
Message |
String |
the error message.
|
|